import gettext
from pyexpat import model
from django.db import models
from django.utils.translation import gettext_lazy as _

class EformSQL(models.Model):

    form_id = models.IntegerField(_("Form id"))    
    form_title = models.CharField(_("Form title"), max_length=255)
    form_element_id = models.CharField(_("Form element id"), max_length=255)
    form_element_title = models.CharField(_("Form element title"), max_length=255)
    form_element_type = models.CharField(_("Form element type"), max_length=255)
    value = models.CharField(_("Value"), max_length=500,null=True,blank=True)
    value_number = models.FloatField(_("Value Number"),null=True,blank=True)
    created = models.DateTimeField(_("Create Date"), auto_now=True)
    class Meta:
        verbose_name = _("EformSQL")
        verbose_name_plural = _("EformSQLs")
        unique_together = [('form_id','form_element_id')]

    def __str__(self):
        return f"{self.form_id } {self.form_element_id}"
